<?php TPL::output('m/header.tpl.htm'); ?>
<style type="text/css">
	.uploads{
		background: #fff;
		color: #fff;
		border: 0;
		border-radius: 2px;
		height: auto;
		position: static;
		align-content: center;
		padding: 10px
	}
	.uploads h4{
		padding-bottom: 5px;color: #666
	}
	.fafb{display: flex;bottom: auto;padding: 10px;}
</style>
<div class="searchbox" style="line-height: 45px;font-weight: bold;margin-bottom: 5px">
	<h1 class="text-center">申请专栏</h1>
</div>
<!-- 内容 -->
<div class="container" style="padding: 0;">
	<form action="column/ajax/apply/" method="post" id="question_form" onsubmit="return false;">
		<input type="hidden" name="post_hash" value="<?php echo new_post_hash(); ?>" />
		<input type="hidden" name="ssid" value="<?php echo $this->ssid;?>" />
		<div class="aw-publish-box" style="margin-top: 0;">
			<div id="step1">
				<article class="fqtitle">
					<input name="name" type="text" placeholder="<?php _e('输入专栏名称'); ?>" value="<?php echo $this->question_info['question_content']; ?>">
				</article>
				<article class=""  style="padding: 10px;background: #fff;margin: 5px 0">
					<textarea name="description"  rows="10" placeholder="<?php _e('专栏详细简介'); ?>" style="width: 100%"><?php echo $this->question_info['description']; ?></textarea>
				</article>
				<article class="uploads" id="upload_files" >
					<h4>专栏封面</h4>
					<img class="showimg" src="/static/css/default/img/default-cover.jpg" width="60" height="60">
					<input type="hidden" name="logo_img" id="logo_img">
				</article>
			</div>
			<div class="command op_btn">
				<article class="fafb" >
					<button onclick="AWS.ajax_post($('#question_form'),function(type,res){if(res.errno<0){layer.msg(res.err)}else{layer.msg(res.err,{},function(){location.href=res.rsm.url})}}); return false;">提交申请</button>
				</article>
			</div>
		</div>
	</form>
</div>
<?php echo hook('osd','init',['cat'=>'column'])?>
<script type="text/javascript" src="/static/js/layer/layer.js"></script>
<!-- end 内容 -->
<script type="text/javascript">
	var ATTACH_ACCESS_KEY = '<?php echo $this->attach_access_key; ?>';
	var PUBLISH_TYPE = 'question';
	var TEMPLATE_MES = '<?php echo $this->template_mes; ?>';
	var is_mobile = '<?php echo is_mobile(); ?>';
    <?php if(is_mobile()){ ?>
        $(window).resize(function(){
        	var winHeight = $(window).height();   //获取当前页面高度
			var thisHeight=$(this).height();
			if(winHeight - thisHeight >50){
				//当软键盘弹出，在这里面操作
				$('.op_btn,.nav').hide()
			}else{
				//当软键盘收起，在此处操作
				$('.op_btn,.nav').show()
			}
		});
    <?php } ?>
    function fabu(){
        if(!$('input[name=question_content]').val().trim()){
            layer.open({
                content: '请输入专栏名称'
                ,skin: 'msg',time: 2
            });
            return false
        }
        if($('input[name=question_content]').val().length < 2){
            layer.open({
                content: '专栏名称不可小于2个字'
                ,skin: 'msg',time: 2
            });
            return false
        }
        AWS.ajax_post($('#question_form'));
    }
	function progress(per){
		layer.msg(per+'%');
	}
	function  adds(file,result){
		result=eval('('+result+')');
		if(result.error<1){
			layer.msg(result.msg);
		}
		$(".showimg").attr('src',result.url);
		$("#logo_img").val(result.url);
	}
</script>
<?php TPL::output('m/footer.tpl.htm'); ?>
